<?php


namespace app\api\model;


class Order extends BaseModel {

    protected $hidden = ['user_id','delete_time','update_time'];

    //自动写入时间戳
    protected $autoWriteTimestamp = true;

    //前端获取订单数量
    public static function getOrderlist($uid,$page,$psize){
        $oList = self::where('user_id',$uid)->order('create_time','desc')->paginate($psize,true,array('page'=>$page));
        return $oList;
    }

    //cms中获取订单列表
    public static function getSummaryByPage($page=1, $size=10){
        $pagingData = self::order('create_time desc')
            ->paginate($size, true, ['page' => $page]);
        return $pagingData ;
    }



}




